<?php /* Smarty version 2.6.20, created on 2012-07-27 06:27:37
         compiled from order_records.html */ ?>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script language="javascript" src="js/tip.js"></script>
<script language="javascript" src="js/allcheck.js"></script>
<script language="javascript">
$(document).ready(function(){
  	var editor;
	KindEditor.ready(function(K) {
		K('select[name=charset]').change(function() {
			if (editor) {
				editor.remove();
				editor = null;
			}
			editor = K.create('textarea[name="content"]', {
				langType : this.value
			});
		});
		K('select[name=charset]').change();
	}); 			   
	$("#domain").validate({
		rules:{
			   article_cat:"required",
			   title:"required"
			  }
		,
		messages:{
			article_cat:"Please choose category.",
			title:"Please input news title."
		},
		errorPlacement:function(error,element){
		error.appendTo(element.parent().parent().next().empty());
	   }
	});
});

function setClick1(ids,isno,field,vals,edit_a){
        if(isno=='yes')
		{
		  var imgs = '<img id='+edit_a+' src="images/no.gif" width="14" height="14" />';
		  $("#"+edit_a).after(imgs).remove();
		  $.post("jquery.php",{con1:vals,id1:ids,field:field});
          $("#"+edit_a).click(function(){
            setClick(ids,'no',field,'1',edit_a);
		  });
		}
		else
		{
		  var imgs = '<img id='+edit_a+' src="images/yes.gif" width="14" height="14" />';
		  $("#"+edit_a).after(imgs).remove();
		  $.post("jquery.php",{con1:vals,id1:ids,field:field});
		  $("#"+edit_a).click(function(){
            setClick(ids,'yes',field,'0',edit_a);
		  });
		}
};

function complete(id)
{
	if(confirm('Are you sure to complete this order?'))
	{
		$.post("order_records.php",{completeId:id},function(data,textStatus){
		/*
											   if(data=1)
											   {
												   location.href="ongoing_orders_list.php";
												   info="Success";
												   msg(info); 												   
												}
											   else{
												   location.href="ongoing_orders_list.php";
												   info="Failure";
												   msg(info);
												   }*/
											   });		
		
	}
}

function del(id)
{
	if(confirm('Are you sure to delete this record?'))
	{
		$.post("order_records.php",{delid:id},function(data,textStatus){
		
											   if(data=1)
											   {
												   info="Success";
												   msg(info);
												}
											   else{
												   info="Failure";
												   msg(info);
												   }
											   });
	}
}

function ConcelBorder(obj)
{
 $(obj).parent().parent().parent().find(".li3").each(function() {
  $(this).css("border","0px");
 });
}
//上移
function UpLi(obj,id)
{
 var onthis = $(obj).parent().parent();
 var getup = $(obj).parent().parent().prev();
 if(getup.html()!=null&&getup.find("td").length==9)
 {
  ConcelBorder(obj); 
 //$(getup).before(onthis);
  $.post("jquery.php",{upid:id},function(data){
  var a=data.split("|");
document.getElementById("mysort_order"+a[1]).innerHTML=a[0];

 });
 }

}
//下移
function DownLi(obj,id)
{
 var onthis = $(obj).parent().parent();
 var getdown = $(obj).parent().parent().next();
 if(getdown.html()!=null)
 {
  ConcelBorder(obj); 
 // $(getdown).after(onthis);
   $.post("jquery.php",{downid:id},function(data){
	var b=data.split("|");
	if(b[1]!="" && b[0]!=""){document.getElementById("mysort_order"+b[1]).innerHTML=b[0];}
	});
 }
}
</script>
<body>
	<form name="form1" action="" method="post">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" valign="top" background="images/mail_leftbg.gif"><img
					src="images/left-top-right.gif" width="17" height="29" /></td>
				<td valign="top" background="images/content-bg.gif"><table
						width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31"><div class="titlebt" style="text-align: 50px">Records</div></td>
						</tr>
					</table></td>
				<td width="16" valign="top" background="images/mail_rightbg.gif"><img
					src="images/nav-right-bg.gif" width="16" height="29" /></td>
			</tr>

			<tr>
				<td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
				<td valign="top" bgcolor="#F7F8F9">

					<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr bgcolor="#f2f2f2"><td>&nbsp;</td><td></td><td></td><td></td></tr>
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt" style="font-weight: bold;color: #000000;">Order Number:&nbsp;<?php echo $this->_tpl_vars['searchId']; ?>
</div></td><td></td><td></td><td></td></tr>
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt" >Origin:&nbsp;<?php echo $this->_tpl_vars['order_details']['origin']; ?>
</td><td></td><td></td><td></td></tr>
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt">Destination:&nbsp;<?php echo $this->_tpl_vars['order_details']['destination']; ?>
</td><td></td><td></td><td></td></tr>
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt">Items:&nbsp;<?php echo $this->_tpl_vars['order_details']['items']; ?>
</td><td></td><td></td><td></td></tr>
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt" >Status:&nbsp;<?php echo $this->_tpl_vars['order_details']['status']; ?>
</td><td></td><td></td><td></td></tr>	
					<tr class="li3" bgcolor="#f2f2f2"><td height="30" class="left_txt" >Receiver:<span style="padding-left:20px;"><input style="width:150px;" type="text" name="$order_details.receiver" value="<?php echo $this->_tpl_vars['order_details']['receiver']; ?>
"></span></td><td></td><td></td><td></td></tr>						
					<tr bgcolor="#f2f2f2"><td>&nbsp;</td><td></td><td></td><td></td></tr>
					<tr td style="border:solid 2px #060"bgcolor="#f2f2f2"><td>&nbsp;</td><td></td><td></td><td></td></tr>

						<tr class="nowtable">
								<td class="left_bt2" style="padding-left: 10px;">Time</td>
							<td class="left_bt2">Location</td>
							<td class="left_bt2">Details</td>
							<td class="left_bt2" align="center">Operation</td>
							<td class="left_bt2"></td>
						</tr>
						<?php $_from = $this->_tpl_vars['record_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['loop']):
?>
						<tr class="li3">
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['time']; ?>
</td>
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['location']; ?>
</td>
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['detail']; ?>
</td>
							<td colspan="2" height="30" bgcolor="#f2f2f2" class="left_txt"
								align="center"><a style="cursor: pointer;"
								onClick="del(<?php echo $this->_tpl_vars['loop']['recordId']; ?>
)"> <img
									src="images/icon_trash.gif" border="0"></a></td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
						<tr class="li3"><td height="30" class="left_txt" bgcolor="#f2f2f2">&nbsp;</td></tr>
						<tr><td colspan="8" align="center" class="left_txt"><?php echo $this->_tpl_vars['pages']; ?>
</td></tr>
						<tr style="padding-top: 10px;"><td><button
								style="cursor: pointer;" onClick="complete(<?php echo $this->_tpl_vars['order_details']['id']; ?>
)">Complete</button></td></tr>
					</table>
				</td>
				<td background="images/mail_rightbg.gif">&nbsp;</td>
			</tr>
			<tr>
				<td valign="bottom" background="images/mail_leftbg.gif"><img
					src="images/buttom_left2.gif" width="17" height="17" /></td>
				<td background="images/buttom_bgs.gif"><img
					src="images/buttom_bgs.gif" width="17" height="17"></td>
				<td valign="bottom" background="images/mail_rightbg.gif"><img
					src="images/buttom_right2.gif" width="16" height="17" /></td>
			</tr>
		</table>
	</form>

<form id="domain" action="order_records.php?act=add" method="post">
<input type="hidden" name="searchId" value="<?php echo $this->_tpl_vars['searchId']; ?>
">
     <table width="99%" border="0" cellspacing="0" cellpadding="0" style="padding-left:10px;">
	 <br>	
     <tr  class="nowtable">
     <td class="left_bt2" style="padding-left:10px;" colspan="2">Add New Record</td>
     </tr>	
     <tr>
     <td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt" style="padding-left:10px; padding-top:15px" align="left">
    Time：<span style="padding-left:40px;"><input style="width:160px;" type="text" name="time" value="<?php echo $this->_tpl_vars['record_list']['time']; ?>
"></span> 
     </td>
     <td bgcolor="#f2f2f2" class="left_txt"></td>
     </tr>
     <tr>
     <td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt" style="padding-left:10px; padding-top:5px" align="left">
    Location：<span style="padding-left:40px;"><input style="width:160px;" type="text" name="location" value="<?php echo $this->_tpl_vars['record_list']['location']; ?>
"></span> 
     </td>
     <td bgcolor="#f2f2f2" class="left_txt"></td>
     </tr>
     <tr>
     <td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt" style="padding-left:10px; padding-top:5px" align="left">
    Details：<span style="padding-left:40px;"><input style="width:160px;" type="text" name="detail" value="<?php echo $this->_tpl_vars['record_list']['detail']; ?>
"></span> 
     </td>
     <td bgcolor="#f2f2f2" class="left_txt"></td>
     </tr>     
     <tr><td align="left" style="padding-left:350px; padding-top:10px"><input type="submit" name="submit" value="Add"></td></tr>
     </table>
  </form>
</body>